package com.ekingstar.lss.commons.supper.model;

import java.io.Serializable;

public class StringIdObject implements Serializable {
	private static final long serialVersionUID = -1538607710147305309L;
	/**
	 * primaryKey
	 */
	private String id;
	/**
	 * 获取表主键,主键名称统一为ID
	 * @return 主键
	 */
	public String getId() {
		return id;
	}

	/**
	 * 设置表主键,主键名称统一为ID
	 * @param id 主键
	 */
	public void setId(String id) {
		this.id = id;
	}

	public boolean equals(Object obj) {
		if(obj==null){
			return false;
		}
		StringIdObject sio=null;
		if(obj instanceof StringIdObject){
			sio=(StringIdObject) obj;
		}else{
			return false;
		}
		if(this.getClass()!=obj.getClass()){
			return false;
		}
		if(!this.id.equals(sio.id)){
			return false;
		}
		return true;
	}

	public int hashCode() {
		return this.id.hashCode()+this.getClass().hashCode();
	}

	public String toString() {
		StringBuffer sb=new StringBuffer();
		sb.append("class:").append(this.getClass().getName()).append("\r\n");
		sb.append("id:").append(this.id);
		return sb.toString();
	}
	
	
}
